package server;


import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

import java.io.Serializable;
import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


@PersistenceCapable
public class GameDB implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1677451698839796430L;

	@PrimaryKey
	@Persistent
	private Key key;

	@Persistent
	private String winner;

	@Persistent
	private String loser;

	@Persistent
	private Date date;

	
	public GameDB(Date date,int id) {
		this.key = KeyFactory.createKey(GameDB.class.getSimpleName(),id);
		this.date = date;
	}

	public String getWinner() {
		return winner;
	}

	public void setWinner(String name1) {
		this.winner = name1;
	}

	public String getLoser() {
		return loser;
	}

	public void setLoser(String name2) {
		this.loser = name2;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
	
	public Key getKey() {
		return key;
	}

}
